import request from '@/utils/request.js'

export function save (data) {
  return request({
    url: '^/violation/save',
    method: 'post',
    data
  })
}
export function selectByDate (date) {
  return request({
    url: '^/violation/selectViolationsByDate?date=' + date,
    method: 'get'
  })
}
export function selectTimesByDate (date) {
  return request({
    url: '^/violation/selectTimesByDate?date=' + date,
    method: 'get'
  })
}
export function vdeleteByDate (date) {
  return request({
    url: '^/violation/deleteByDate?date=' + date,
    method: 'get'
  })
}
export function getAnalysisData (begin, end) {
  return request({
    url: '^/violation/analysisData?begin=' + begin + '&end=' + end,
    method: 'get'
  })
}
export function getWeeklyData () {
  return request({
    url: '^/violation/weeklyData',
    method: 'get'
  })
}
export function selectViolationByRange (begin, end) {
  return request({
    url: '^/violation/getByRange?begin=' + begin + '&end=' + end,
    method: 'get'
  })
}

